<!DOCTYPE html>
<?php

require_once ('conn.php');
require_once ('top.php');
if($_SESSION['role']==2){
     Header("Location:supply_index.php"); 
    }elseif($_SESSION['role']==3){
     Header("Location:dotlistMaster.php"); 
   }
$contactNumber = $_GET['contactNumber'];
$ci_contact = mysql_fetch_row(mysql_query("select id,name from ci_contact where number ='$contactNumber'"));
?>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>优易购</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <link rel="stylesheet" href="css/jquery.lineProgressbar.css">
    <script src="js/jquery-1.11.0.min.js"></script>
    <script src="js/jquery.lineProgressbar.js"></script>
</head>
<body>
    <div class="top">
        <span onclick="javascript:history.go(-1);" class="fanhui">返回</span>
        <span><?=$ci_contact[1]?></span>
        <div class="tright"><span class="outlogin">退出登陆</span></div>
    </div>
    
    <?php
    $result=mysql_query("select * from ci_wdgoods where contactNumber='$contactNumber' "); 
    $i=0;
    $but=0;
    while($row=mysql_fetch_array($result)) 
    {
       
        $num = mysql_fetch_row(mysql_query("select SUM(num) from ci_wx_order_goods where customerNumber ='".$row['contactNumber']."'  and status=2 and payStatus = 1 and goodsNumber='".$row['goodsNumber']."'"));//补货数量
        $good = mysql_fetch_row(mysql_query("select id,name from ci_goods where number='".$row['goodsNumber']."' "));
        $goodimg = mysql_fetch_row(mysql_query("select url from ci_goods_img where invId=$good[0] "));
        $img ="img/goods.png";

        if($goodimg[0]!=""){
              $img = $goodimg[0];
        }
        if($num[0]>0){
    ?>
    <div class="list3">
        <div class="list100">
            <div class="goods">
                <img src="<?=$img?>" alt="">
                <span class="goodname"><?=$good[1]?></span><br>
                <span class="goodnum">共补货数量：<?=$num[0]?></span>
            </div>
        </div>
    </div>
    
   <?php
    } 
    }
    ?>
    
    <div style=" width:100%;height:100px; float:left;"></div>
    <div class="foot">
        <a href="index.php">
        <div>
        <img src="img/f11.png" alt="">
        <p>首页数据</p>
        </div>
        </a>
        <a href="market.php">
        <div>
        <img src="img/f22.png" alt="">
        <p>全部网点</p>
        </div>
        </a>
        
        
        <div  class="footon">
        <img src="img/f3.png" alt="">
        <p>补货记录</p>
        </div>
       
    </div>
</body>
<script src="js/outlogin.js"></script>
</html>